import numpy as np
import cv2
img = cv2.imread(r'G:\pythonScrip\opencv\2.jpg',1) #1, 0 or -1  cv2.IMREAD_COLOR cv2.IMREAD_GRAYSCALE cv2.IMREAD_UNCHANGED 
cv2.imshow('image',img)
cv2.imwrite(r'G:\pythonScrip\opencv\3.jpg',img)
while True:
	k = cv2.waitKey(0)&0xFF
	print k,'\t',ord('s')
	if k == 27:         # wait for ESC key to exit
		cv2.destroyAllWindows()
		break
	elif k == ord('s'): # wait for 's' key to save and exit
		cv2.imwrite(r'G:\pythonScrip\opencv\4.jpg',img)